<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all">
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend style="text-align: center">iArchie博客</legend>
</fieldset>

<div style="padding: 20px; background-color: #F2F2F2;">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">设置我的基本资料</div>
                <form class="layui-form" action="">
                    <div class="layui-card-body">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">用户名:</label>
                                <div class="layui-input-inline">
                                    <input readonly="readonly" name="text" placeholder="admin" lay-verify="readonly"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <span style="color: #8D8D8D">一般作为后台登入名，不可以更改！</span>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">昵&nbsp;称:</label>
                            <div class="layui-input-inline">
                                <input type="text" name="text" placeholder="iArchie" lay-verify="readonly"
                                       autocomplete="off" class="layui-input">
                            </div>
                            <br>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">性&nbsp;别:</label>
                            <div class="layui-input-block">
                                <input type="radio" name="sex" value="男" title="男">
                                <input type="radio" name="sex" value="女" title="女" checked>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">头&nbsp;像:</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="text" placeholder="图片地址" lay-verify="readonly"
                                           autocomplete="off" class="layui-input">
                                </div>
                                <br>
                            </div>
                            <button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传图片</button>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">手机号:</label>
                            <div class="layui-input-inline">
                                <input type="tel" name="phone" placeholder="请输入手机号" lay-verify="required|phone"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <br><br>
                        <div class="layui-inline">
                            <label class="layui-form-label">邮&nbsp;箱:</label>
                            <div class="layui-input-inline">
                                <input type="text" name="email" placeholder="请输入邮箱" lay-verify="email"
                                       autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <br><br>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">备&nbsp;注:</label>
                            <div class="layui-input-block">
                                <textarea name="desc" placeholder="请输入内容" class="layui-textarea"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script src="../../layui/layui.js"></script>
<script>
    //单选按钮
    layui.use('form', function () {
        var form = layui.form;
        //监听提交
        form.on('submit(formDemo)', function (data) {
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
    //-----------------------------
    layui.use('upload', function () {
        var $ = layui.jquery
            , upload = layui.upload;
        //指定允许上传的文件类型
        upload.render({
            elem: '#test3'
            , url: '/upload/'
            , accept: 'file' //普通文件
            , done: function (res) {
                console.log(res)
            }
        });
    });
</script>
</body>
</html>